package work;

public class GeometricTest {

	public static void main(String[] args) {
		
		Circle circle = new Circle("蓝色",3,3.5);
		
		MyRectangle myRectangle = new MyRectangle("红色",3,4,5);
		
		boolean equalsArea = equalsArea(circle,myRectangle);
		
		if(equalsArea){
			System.out.println("两个对象的面积相等");
		}else{
			System.out.println("两个对象的面积不相等");
		}
		
		
		displayGeometricObject(circle);
		
		displayGeometricObject(myRectangle);
		
	}

	public static boolean equalsArea(GeometricObject geome1,GeometricObject geome2){
		
		double findArea1 = geome1.findArea();
		
		double findArea2 = geome2.findArea();
		
		return findArea1 == findArea2;
		
		
	}
	
	public static void displayGeometricObject(GeometricObject geome){
		
		double findArea = geome.findArea();
		System.out.println(findArea);
	}

}
